

var arrnum = [1,2,3,45,6]

arrnum.sort1Sort=
function () {
  
    var item = this[0]
    var idx =0;
    for (var i = 1 ; i < this.length; i++) {
            if (this[i]<item) {
                item=this[i]
                idx = i;                
            }


            if (this[0] !== item) {
                    var a = this[0];
                    this[0]=item;
                    this[idx]=0;

                
            }
        console.log(arrnum);
    }
}
console.log(arrnum)